@extends('admin.layouts.app')


@section('content')

                        <!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="page-title">预约管理</h4>
                                <ol class="breadcrumb">
                                    <li><a href="{{url('zadmin')}}">系统</a></li>
                                   
                                    <li class="active">预约列表</li>
                                </ol>
                            </div>
                        </div>
                        
                        <div class="row">
                        	<div class="col-lg-12">
                        		<div class="card-box">
                        			<div class="row">
			                        	<div class="col-sm-8">
			                        		<form role="form" id="form1">
			                                    <div class="form-group contact-search  col-sm-6">
			                                    	<input type="text" name="keyword" class="form-control " placeholder="输入手机号/车牌号搜索" value="{{array_get($param,'keyword')}}">
                                          </div>
                                          <div class="form-group col-sm-4">
                                         
                                        </div>
                                            <div class="col-sm-2">
			                   <button type="button" class="btn btn-white btn-submit"><i class="fa fa-search"></i></button>
                       </div>
			                                     <!-- form-group -->
			                                </form>
			                        	</div>
                               
			                        	
			                        </div>

                              @if(session('rs'))
                              <div class="alert alert-{{session('rs')['status']}}">
                                {{ session('rs')['msg'] }}
                              </div>
                              @endif
			                        
                        			<div class="table-responsive">
    <table class="table table-hover">
        <thead>
			<tr>
				<th style="min-width: 35px;">
					<div class="checkbox checkbox-primary checkbox-single m-r-15">
            <input id="action-checkbox" type="checkbox">
              <label for="action-checkbox"></label>
                    </div>
                                                        
													</th>
						           
                        <th>联系人</th>
                       
                        <th>送修人电话</th>

                        <th>车牌号</th>                       
                        
                        <th>预约时间</th>
                        <th>故障信息</th>
                        
                          
                        
                         
						
                         
					<th style="width: 200px;">操作</th>
					</tr>
					</thead>
											
                    <tbody>

                    @foreach($list as $v)
                        <tr>
                            <td>
                                {{$v->id}}
                                                        
                                                      
                            </td>
                                                    
          
            <td>{{$v->name}}</td>                        
            <td>
                            {{$v->phone}}
                                    </td>

                                                   
                                                    
                      <td>{{$v->car_num}}</td>
                      <td>{{$v->booking_time}}</td>
                      <td>{{$v->bug_info}}</td>
                                                  
                                                    
                                                    
                                                   
                                                    <td>
                                                   


                                                     

                                                      

<a class="btn btn-purple btn-sm" href="{{url('zadmin/booking/edit',$v->id)}}">修改</a>                                                     

                                                                                                            
<a class="btn btn-danger btn-sm" href="{{url('zadmin/booking/del',$v->id)}}" class="del" data-id="{{$v->id}}">删除</a>
                                                    </td>
                                                </tr>
                                            @endforeach    
                                                
                                               
                                               
                                                
                                               
                                                
                                            
                                            </tbody>
                                        </table>
                                    </div>
                                    {{ $list->appends($param)->links() }}
                        		</div>
                                
                            </div> <!-- end col -->

                            
                        </div>
@endsection

@section('modal')                        
<!--派工-->
<div class="modal fade" id="dispatchModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
          &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">
          派工
        </h4>
      </div>
       <form class="form-horizontal" role="form" action="{{url('zadmin/process')}}" method="post">
      <div class="modal-body">
       
       
        <div class="form-group">
                  <label class="control-label">备注</label>
                 
                    <textarea class="form-control"  name="remark"></textarea>
                 
        </div> 
     
       <input type="hidden" name="task_id" value="" />
       {{csrf_field()}}
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
        </button>
        <button type="submit" class="btn btn-primary">
          提交
        </button>
      </div>
    </form>
    </div><!-- /.modal-content -->
  </div>
</div> 
<!-- /.modal -->                        
@endsection                         

                  
            
    
       

           



    
@section('js')
<script type="text/javascript">
    $('.btn-dispath').on('click',function(){
        var task_id = $(this).data('id');
        $('#dispatchModal').modal('show');
        $('input[name="task_id"]').val(task_id);
    });

    $('#exportBtn').on('click',function(){
      var url = "{{url('zadmin/task/export')}}";
      $('#form1').attr('action',url).submit(); 
    });

    $('.btn-submit').on('click',function(){
      var url = "{{url('zadmin/booking')}}";
      $('#form1').attr('action',url).submit();
    });
</script>
         
@endsection
    
